<div class="easyui-tabs config-tabs" data-options="fit:true">
    <div title="物流快递" class="con"  style="-moz-user-select:none;">
        <div id="tb1<?php echo $uniqid;?>" style="padding:5px">
            <table cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td><a href="javascript:;" onclick="dispatchAdd('express');" class="l-btn l-btn-small l-btn-plain"><span
                            class="l-btn-left l-btn-icon-left"><i class="iconfont icon-tianjia1"></i><span class="l-btn-text">增加</span></span></a></td>
                    <td>
                        <div class="datagrid-btn-separator"></div>
                    </td>
                    <td><a href="javascript:;" onclick="dispatchEdit1();" class="l-btn l-btn-small l-btn-plain"><span
                            class="l-btn-left l-btn-icon-left"><i class="iconfont icon-bianji"></i><span class="l-btn-text">编辑</span></span></a></td>
                    <td>
                        <div class="datagrid-btn-separator"></div>
                    </td>
                    <td><a href="javascript:;" onclick="dispatchReload1();" class="l-btn l-btn-small l-btn-plain"><span
                            class="l-btn-left l-btn-icon-left"><i class="iconfont icon-shuaxin"></i><span class="l-btn-text">重载</span></span></a></td>
                    <td>&nbsp;&nbsp;<input id="dispatchKeywords1" style="width:100px" type="text" class="easyui-input textbox"></td>
                    <td><a href="javascript:void(0);" onclick="dispatchSearch1();" class="l-btn l-btn-small l-btn-plain"><span
                            class="l-btn-left l-btn-icon-left"><i class="iconfont icon-sousuo"></i><span class="l-btn-text">查询</span></span></a></td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="con"  style="-moz-user-select:none;">
            <table id="dispatch_express"></table>
        </div>
    </div>
    <div title="商家配送" class="con"  style="-moz-user-select:none;">
        <div id="tb2<?php echo $uniqid;?>" style="padding:5px">
            <table cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td><a href="javascript:;" onclick="dispatchAdd('store');" class="l-btn l-btn-small l-btn-plain"><span
                            class="l-btn-left l-btn-icon-left"><i class="iconfont icon-tianjia1"></i><span class="l-btn-text">增加</span></span></a></td>
                    <td>
                        <div class="datagrid-btn-separator"></div>
                    </td>
                    <td><a href="javascript:;" onclick="dispatchEdit2();" class="l-btn l-btn-small l-btn-plain"><span
                            class="l-btn-left l-btn-icon-left"><i class="iconfont icon-bianji"></i><span class="l-btn-text">编辑</span></span></a></td>
                    <td>
                        <div class="datagrid-btn-separator"></div>
                    </td>
                    <td><a href="javascript:;" onclick="dispatchReload2();" class="l-btn l-btn-small l-btn-plain"><span
                            class="l-btn-left l-btn-icon-left"><i class="iconfont icon-shuaxin"></i><span class="l-btn-text">重载</span></span></a></td>
                    <td>&nbsp;&nbsp;<input id="dispatchKeywords2" style="width:100px" type="text" class="easyui-input textbox"></td>
                    <td><a href="javascript:void(0);" onclick="dispatchSearch2();" class="l-btn l-btn-small l-btn-plain"><span
                            class="l-btn-left l-btn-icon-left"><i class="iconfont icon-sousuo"></i><span class="l-btn-text">查询</span></span></a></td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="con"  style="-moz-user-select:none;">
            <table id="dispatch_store"></table>
        </div>
    </div>
    <div title="到店/自提" class="con"  style="-moz-user-select:none;">
        <div id="tb3<?php echo $uniqid;?>" style="padding:5px">
            <table cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td><a href="javascript:;" onclick="dispatchAdd('selfetch');" class="l-btn l-btn-small l-btn-plain"><span
                            class="l-btn-left l-btn-icon-left"><i class="iconfont icon-tianjia1"></i><span class="l-btn-text">增加</span></span></a></td>
                    <td>
                        <div class="datagrid-btn-separator"></div>
                    </td>
                    <td><a href="javascript:;" onclick="dispatchEdit3();" class="l-btn l-btn-small l-btn-plain"><span
                            class="l-btn-left l-btn-icon-left"><i class="iconfont icon-bianji"></i><span class="l-btn-text">编辑</span></span></a></td>
                    <td>
                        <div class="datagrid-btn-separator"></div>
                    </td>
                    <td><a href="javascript:;" onclick="dispatchReload3();" class="l-btn l-btn-small l-btn-plain"><span
                            class="l-btn-left l-btn-icon-left"><i class="iconfont icon-shuaxin"></i><span class="l-btn-text">重载</span></span></a></td>
                    <td>&nbsp;&nbsp;<input id="dispatchKeywords3" style="width:100px" type="text" class="easyui-input textbox"></td>
                    <td><a href="javascript:void(0);" onclick="dispatchSearch3();" class="l-btn l-btn-small l-btn-plain"><span
                            class="l-btn-left l-btn-icon-left"><i class="iconfont icon-sousuo"></i><span class="l-btn-text">查询</span></span></a></td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="con"  style="-moz-user-select:none;">
            <table id="dispatch_selfetch"></table>
        </div>
    </div>
    <div title="自动发货" class="con"  style="-moz-user-select:none;">
        <div id="tb4<?php echo $uniqid;?>" style="padding:5px">
            <table cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td><a href="javascript:;" onclick="dispatchAdd('autosend');" class="l-btn l-btn-small l-btn-plain"><span
                            class="l-btn-left l-btn-icon-left"><i class="iconfont icon-tianjia1"></i><span class="l-btn-text">增加</span></span></a></td>
                    <td>
                        <div class="datagrid-btn-separator"></div>
                    </td>
                    <td><a href="javascript:;" onclick="dispatchEdit4();" class="l-btn l-btn-small l-btn-plain"><span
                            class="l-btn-left l-btn-icon-left"><i class="iconfont icon-bianji"></i><span class="l-btn-text">编辑</span></span></a></td>
                    <td>
                        <div class="datagrid-btn-separator"></div>
                    </td>
                    <td><a href="javascript:;" onclick="dispatchReload4();" class="l-btn l-btn-small l-btn-plain"><span
                            class="l-btn-left l-btn-icon-left"><i class="iconfont icon-shuaxin"></i><span class="l-btn-text">重载</span></span></a></td>
                    <td>&nbsp;&nbsp;<input id="dispatchKeywords4" style="width:100px" type="text" class="easyui-input textbox"></td>
                    <td><a href="javascript:void(0);" onclick="dispatchSearch4();" class="l-btn l-btn-small l-btn-plain"><span
                            class="l-btn-left l-btn-icon-left"><i class="iconfont icon-sousuo"></i><span class="l-btn-text">查询</span></span></a></td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="con"  style="-moz-user-select:none;">
            <table id="dispatch_autosend"></table>
        </div>
    </div>
</div>
<div id="dispatchDlg" class="easyui-dialog" style="width:840px; height:450px;" title="信息框" closed="true"></div>
<script>
    var dispatchAdd = function (type) {
        $("#dispatchDlg").dialog({
            title: '添加发货模板',
            closed: false,
            width: 840,
            height: 450,
            cache: false,
            href: '/admin/dispatch/add?type=' + type,
            modal: true,
            buttons: [{
                text: '保存',
                id: 'dispatchsubmit',
                iconCls: 'icon-ok',
            }, {
                text: '关闭',
                iconCls: 'icon-no',
                handler: function () {
                    $("#dispatchDlg").dialog('close');
                }
            }]
        });
    };
    var dispatchEdit1 = function (id) {
        let rowId = id || ($('#dispatch_express').datagrid('getSelected') && $('#dispatch_express').datagrid('getSelected').id);
        if (rowId) {
            $("#dispatchDlg").dialog({
                title: '编辑信息',
                closed: false,
                width: 840,
                height: 450,
                cache: false,
                href: '/admin/dispatch/edit?type=express&id=' + rowId,
                modal: true,
                buttons: [{
                    text: '保存',
                    id: 'dispatchsubmit',
                    iconCls: 'icon-ok',
                }, {
                    text: '关闭',
                    iconCls: 'icon-no',
                    handler: function () {
                        $("#dispatchDlg").dialog('close');
                    }
                }]
            });
        } else {
            $.messager.alert('提示', '请先选择要编辑的行！', 'warning');
        }
    };
    var dispatchEdit2 = function (id) {
        let rowId = id || ($('#dispatch_store').datagrid('getSelected') && $('#dispatch_store').datagrid('getSelected').id);
        if (rowId) {
            $("#dispatchDlg").dialog({
                title: '编辑信息',
                closed: false,
                width: 840,
                height: 450,
                cache: false,
                href: '/admin/dispatch/edit?type=store&id=' + rowId,
                modal: true,
                buttons: [{
                    text: '保存',
                    id: 'dispatchsubmit',
                    iconCls: 'icon-ok',
                }, {
                    text: '关闭',
                    iconCls: 'icon-no',
                    handler: function () {
                        $("#dispatchDlg").dialog('close');
                    }
                }]
            });
        } else {
            $.messager.alert('提示', '请先选择要编辑的行！', 'warning');
        }
    };
    var dispatchEdit3 = function (id) {
        let rowId = id || ($('#dispatch_selfetch').datagrid('getSelected') && $('#dispatch_selfetch').datagrid('getSelected').id);
        if (rowId) {
            $("#dispatchDlg").dialog({
                title: '编辑信息',
                closed: false,
                width: 840,
                height: 450,
                cache: false,
                href: '/admin/dispatch/edit?type=selfetch&id=' + rowId,
                modal: true,
                buttons: [{
                    text: '保存',
                    id: 'dispatchsubmit',
                    iconCls: 'icon-ok',
                }, {
                    text: '关闭',
                    iconCls: 'icon-no',
                    handler: function () {
                        $("#dispatchDlg").dialog('close');
                    }
                }]
            });
        } else {
            $.messager.alert('提示', '请先选择要编辑的行！', 'warning');
        }
    };
    var dispatchEdit4 = function (id) {
        let rowId = id || ($('#dispatch_autosend').datagrid('getSelected') && $('#dispatch_autosend').datagrid('getSelected').id);
        if (rowId) {
            $("#dispatchDlg").dialog({
                title: '编辑信息',
                closed: false,
                width: 840,
                height: 450,
                cache: false,
                href: '/admin/dispatch/edit?type=autosend&id=' + rowId,
                modal: true,
                buttons: [{
                    text: '保存',
                    id: 'dispatchsubmit',
                    iconCls: 'icon-ok',
                }, {
                    text: '关闭',
                    iconCls: 'icon-no',
                    handler: function () {
                        $("#dispatchDlg").dialog('close');
                    }
                }]
            });
        } else {
            $.messager.alert('提示', '请先选择要编辑的行！', 'warning');
        }
    };
    var dispatchDelete1 = function (id) {
        let rowId = id || ($('#dispatch_express').datagrid('getSelected') && $('#dispatch_express').datagrid('getSelected').id);
        if (rowId) {
            $.messager.confirm('提示', '确定删除吗？', function (r) {
                if (r) {
                    $.messager.progress();
                    $.post('/admin/dispatch/delete', {id: rowId}, function (data) {
                        $.messager.progress('close');
                        if (parseInt(data.ret) === 0) {
                            $.messager.show({
                                title: '提示',
                                msg: data.msg,
                                timeout: 3000,
                                showType: 'slide'
                            });
                            dispatchReload1();
                        } else {
                            $.messager.alert('提示', data.msg, 'warning');
                        }
                    }, 'json');
                }
            });
        } else {
            $.messager.alert('提示', '请先选择要删除的记录！', 'warning');
        }
    };
    var dispatchDelete2 = function (id) {
        let rowId = id || ($('#dispatch_store').datagrid('getSelected') && $('#dispatch_store').datagrid('getSelected').id);
        if (rowId) {
            $.messager.confirm('提示', '确定删除吗？', function (r) {
                if (r) {
                    $.messager.progress();
                    $.post('/admin/dispatch/delete', {id: rowId}, function (data) {
                        $.messager.progress('close');
                        if (parseInt(data.ret) === 0) {
                            $.messager.show({
                                title: '提示',
                                msg: data.msg,
                                timeout: 3000,
                                showType: 'slide'
                            });
                            dispatchReload2();
                        } else {
                            $.messager.alert('提示', data.msg, 'warning');
                        }
                    }, 'json');
                }
            });
        } else {
            $.messager.alert('提示', '请先选择要删除的记录！', 'warning');
        }
    };
    var dispatchDelete3 = function (id) {
        let rowId = id || ($('#dispatch_selfetch').datagrid('getSelected') && $('#dispatch_selfetch').datagrid('getSelected').id);
        if (rowId) {
            $.messager.confirm('提示', '确定删除吗？', function (r) {
                if (r) {
                    $.messager.progress();
                    $.post('/admin/dispatch/delete', {id: rowId}, function (data) {
                        $.messager.progress('close');
                        if (parseInt(data.ret) === 0) {
                            $.messager.show({
                                title: '提示',
                                msg: data.msg,
                                timeout: 3000,
                                showType: 'slide'
                            });
                            dispatchReload3();
                        } else {
                            $.messager.alert('提示', data.msg, 'warning');
                        }
                    }, 'json');
                }
            });
        } else {
            $.messager.alert('提示', '请先选择要删除的记录！', 'warning');
        }
    };
    var dispatchDelete4 = function (id) {
        let rowId = id || ($('#dispatch_autosend').datagrid('getSelected') && $('#dispatch_autosend').datagrid('getSelected').id);
        if (rowId) {
            $.messager.confirm('提示', '确定删除吗？', function (r) {
                if (r) {
                    $.messager.progress();
                    $.post('/admin/dispatch/delete', {id: rowId}, function (data) {
                        $.messager.progress('close');
                        if (parseInt(data.ret) === 0) {
                            $.messager.show({
                                title: '提示',
                                msg: data.msg,
                                timeout: 3000,
                                showType: 'slide'
                            });
                            dispatchReload4();
                        } else {
                            $.messager.alert('提示', data.msg, 'warning');
                        }
                    }, 'json');
                }
            });
        } else {
            $.messager.alert('提示', '请先选择要删除的记录！', 'warning');
        }
    };
    var dispatchReload1 = function () {
        $("#dispatch_express").datagrid('reload');
    };
    var dispatchReload2 = function () {
        $("#dispatch_store").datagrid('reload');
    };
    var dispatchReload3 = function () {
        $("#dispatch_selfetch").datagrid('reload');
    };
    var dispatchReload4 = function () {
        $("#dispatch_autosend").datagrid('reload');
    };
    var dispatchSearch1 = function () {
        var height = $(window).height() - $(".top").height() - 90;
        var width = $(window).width() - $(".leftmenu").width() - 8;
        $("#dispatch_express").datagrid({
            width: width,
            height: height,//高度
            singleSelect: true,//如果为true，则只允许选择一行
            striped: true,//是否显示斑马线效果。
            rownumbers: true,//如果为true，则显示一个行号列。
            pagination: true,//是否显示分页
            pageSize: 10,
            pageList: [10, 15, 20, 25],
            method: 'post',
            sortName: 'id',
            sortOrder: 'desc',
            idField: 'id',
            treeField: 'name',
            url: '/admin/dispatch/index',
            queryParams: {
                type: 'express',
                keywords: $('#dispatchKeywords1').val()
            },
            fitColumns: true,//真正的自动展开/收缩列的大小，以适应网格的宽度，防止水平滚动。
            nowrap: true,//如果为true，则在同一行中显示数据。设置为true可以提高加载性能。 是否换行
            selectOnCheck: false,
            checkOnSelect: true,
            toolbar: '#tb1<?php echo $uniqid;?>',
            columns: [[
                {field: 'name', title: '名称', width: fixWidth(30)},
                {field: 'type', title: '发货方式', width: fixWidth(10)},
                {field: 'type_ids', title: '配送区域', width: fixWidth(23)},
                {field: 'action', title: '操作', width: fixWidth(30), formatter: function (value, rowData, rowIndex) {
                        return '<a href="javascript:;" class="l-btn l-btn-small" onclick="dispatchEdit1(' + rowData.id + ')" ><span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">编辑</span><span class="l-btn-icon icon-ok">&nbsp;</span></span></a>&nbsp;&nbsp;'+
                            '<a href="javascript:;" class="l-btn l-btn-small" onClick="dispatchDelete1(' + rowData.id + ')"><span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">删除</span><span class="l-btn-icon icon-no">&nbsp;</span></span></a>';
                    }
                },
            ]],
            onDblClickRow : function(index,field){
                dispatchEdit1();
            }
        });
    };
    var dispatchSearch2 = function () {
        var height = $(window).height() - $(".top").height() - 90;
        var width = $(window).width() - $(".leftmenu").width() - 8;
        $("#dispatch_store").datagrid({
            width: width,
            height: height,//高度
            singleSelect: true,//如果为true，则只允许选择一行
            striped: true,//是否显示斑马线效果。
            rownumbers: true,//如果为true，则显示一个行号列。
            pagination: true,//是否显示分页
            pageSize: 10,
            pageList: [10, 15, 20, 25],
            method: 'post',
            sortName: 'id',
            sortOrder: 'desc',
            idField: 'id',
            treeField: 'name',
            url: '/admin/dispatch/index',
            queryParams: {
                type: 'store',
                keywords: $('#dispatchKeywords2').val()
            },
            fitColumns: true,//真正的自动展开/收缩列的大小，以适应网格的宽度，防止水平滚动。
            nowrap: true,//如果为true，则在同一行中显示数据。设置为true可以提高加载性能。 是否换行
            selectOnCheck: false,
            checkOnSelect: true,
            toolbar: '#tb2<?php echo $uniqid;?>',
            columns: [[
                {field: 'name', title: '名称', width: fixWidth(20)},
                {field: 'store', title: '可配送门店', width: fixWidth(30), formatter: function (value, rowData, rowIndex) {
                    let content = '';
                    if(value){
                        if(value.store_ids === ''){
                            content = '全部门店';
                        }else{
                            content += '部分门店<span style="color: #f0af41">('+value.store_names+')</span>'
                        }
                    }
                    return content;
                    }},
                {field: 'updated_at', title: '最后修改时间', width: fixWidth(20), formatter: function (value, rowData, rowIndex) {
                        if(value){
                            return value;
                        }
                        return rowData.created_at;
                    }},
                {field: 'action', title: '操作', width: fixWidth(30), formatter: function (value, rowData, rowIndex) {
                        return '<a href="javascript:;" class="l-btn l-btn-small" onclick="dispatchEdit2(' + rowData.id + ')" ><span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">编辑</span><span class="l-btn-icon icon-ok">&nbsp;</span></span></a>&nbsp;&nbsp;'+
                            '<a href="javascript:;" class="l-btn l-btn-small" onClick="dispatchDelete2(' + rowData.id + ')"><span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">删除</span><span class="l-btn-icon icon-no">&nbsp;</span></span></a>';
                    }
                },
            ]],
            onDblClickRow : function(index,field){
                dispatchEdit2();
            }
        });
    };
    var dispatchSearch3 = function () {
        var height = $(window).height() - $(".top").height() - 90;
        var width = $(window).width() - $(".leftmenu").width() - 8;
        $("#dispatch_selfetch").datagrid({
            width: width,
            height: height,//高度
            singleSelect: true,//如果为true，则只允许选择一行
            striped: true,//是否显示斑马线效果。
            rownumbers: true,//如果为true，则显示一个行号列。
            pagination: true,//是否显示分页
            pageSize: 10,
            pageList: [10, 15, 20, 25],
            method: 'post',
            sortName: 'id',
            sortOrder: 'desc',
            idField: 'id',
            treeField: 'name',
            url: '/admin/dispatch/index',
            queryParams: {
                type: 'selfetch',
                keywords: $('#dispatchKeywords3').val()
            },
            fitColumns: true,//真正的自动展开/收缩列的大小，以适应网格的宽度，防止水平滚动。
            nowrap: true,//如果为true，则在同一行中显示数据。设置为true可以提高加载性能。 是否换行
            selectOnCheck: false,
            checkOnSelect: true,
            toolbar: '#tb3<?php echo $uniqid;?>',
            columns: [[
                {field: 'name', title: '名称', width: fixWidth(20)},
                {field: 'selfetch', title: '自提门店', width: fixWidth(30), formatter: function (value, rowData, rowIndex) {
                        let content = '';
                        if(value){
                            if(value.store_ids === ''){
                                content = '所有门店';
                            }else{
                                content += '部分门店<span style="color: #f0af41">('+value.store_names+')</span>'
                            }
                        }
                        return content;
                    }},
                {field: 'expire_days', title: '自提有效期', width: fixWidth(15), formatter: function (value, rowData, rowIndex) {
                        let expire_days = '无';
                        if(rowData.selfetch){
                            if(rowData.selfetch.expire_type === 'day'){
                                expire_days = rowData.selfetch.expire_day+'天';
                            }
                            if(rowData.selfetch.expire_type === 'time'){
                                expire_days = rowData.selfetch.expire_time_text;
                            }
                        }
                        return expire_days;
                    }},
                {field: 'updated_at', title: '最后修改时间', width: fixWidth(15), formatter: function (value, rowData, rowIndex) {
                        if(value){
                            return value;
                        }
                        return rowData.created_at;
                    }},
                {field: 'action', title: '操作', width: fixWidth(20), formatter: function (value, rowData, rowIndex) {
                        return '<a href="javascript:;" class="l-btn l-btn-small" onclick="dispatchEdit3(' + rowData.id + ')" ><span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">编辑</span><span class="l-btn-icon icon-ok">&nbsp;</span></span></a>&nbsp;&nbsp;'+
                            '<a href="javascript:;" class="l-btn l-btn-small" onClick="dispatchDelete3(' + rowData.id + ')"><span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">删除</span><span class="l-btn-icon icon-no">&nbsp;</span></span></a>';
                    }
                },
            ]],
            onDblClickRow : function(index,field){
                dispatchEdit3();
            }
        });
    };
    var dispatchSearch4 = function () {
        var height = $(window).height() - $(".top").height() - 90;
        var width = $(window).width() - $(".leftmenu").width() - 8;
        $("#dispatch_autosend").datagrid({
            width: width,
            height: height,//高度
            singleSelect: true,//如果为true，则只允许选择一行
            striped: true,//是否显示斑马线效果。
            rownumbers: true,//如果为true，则显示一个行号列。
            pagination: true,//是否显示分页
            pageSize: 10,
            pageList: [10, 15, 20, 25],
            method: 'post',
            sortName: 'id',
            sortOrder: 'desc',
            idField: 'id',
            treeField: 'name',
            url: '/admin/dispatch/index',
            queryParams: {
                type: 'autosend',
                keywords: $('#dispatchKeywords4').val()
            },
            fitColumns: true,//真正的自动展开/收缩列的大小，以适应网格的宽度，防止水平滚动。
            nowrap: true,//如果为true，则在同一行中显示数据。设置为true可以提高加载性能。 是否换行
            selectOnCheck: false,
            checkOnSelect: true,
            toolbar: '#tb4<?php echo $uniqid;?>',
            columns: [[
                {field: 'name', title: '名称', width: fixWidth(30)},
                {field: 'type', title: '发货方式', width: fixWidth(10)},
                {field: 'type_ids', title: '包含模板', width: fixWidth(23)},
                {field: 'action', title: '操作', width: fixWidth(30), formatter: function (value, rowData, rowIndex) {
                        return '<a href="javascript:;" class="l-btn l-btn-small" onclick="dispatchEdit4(' + rowData.id + ')" ><span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">编辑</span><span class="l-btn-icon icon-ok">&nbsp;</span></span></a>&nbsp;&nbsp;'+
                            '<a href="javascript:;" class="l-btn l-btn-small" onClick="dispatchDelete4(' + rowData.id + ')"><span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">删除</span><span class="l-btn-icon icon-no">&nbsp;</span></span></a>';
                    }
                },
            ]],
            onDblClickRow : function(index,field){
                dispatchEdit4();
            }
        });
    };
    dispatchSearch1();
    dispatchSearch2();
    dispatchSearch3();
    dispatchSearch4();
    onDatagridResize('#dispatch_express', 50);
    onDatagridResize('#dispatch_store', 50);
    onDatagridResize('#dispatch_selfetch', 50);
    onDatagridResize('#dispatch_autosend', 50);
</script>
